package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "sys_log", schema = "", catalog = "onedollar")
public class SysLogEntity {
    private int id;
    private Integer adminId;
    private String module;
    private String action;
    private String handle;
    private String handleMan;
    private String content;
    private Timestamp handleDatetime;
    private String handleIp;
    private Integer handleType;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "admin_id", nullable = true, insertable = true, updatable = true)
    public Integer getAdminId() {
        return adminId;
    }

    public void setAdminId(Integer adminId) {
        this.adminId = adminId;
    }

    @Basic
    @Column(name = "module", nullable = true, insertable = true, updatable = true, length = 20)
    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    @Basic
    @Column(name = "action", nullable = true, insertable = true, updatable = true, length = 50)
    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    @Basic
    @Column(name = "handle", nullable = true, insertable = true, updatable = true, length = 2)
    public String getHandle() {
        return handle;
    }

    public void setHandle(String handle) {
        this.handle = handle;
    }

    @Basic
    @Column(name = "handle_man", nullable = true, insertable = true, updatable = true, length = 30)
    public String getHandleMan() {
        return handleMan;
    }

    public void setHandleMan(String handleMan) {
        this.handleMan = handleMan;
    }

    @Basic
    @Column(name = "content", nullable = true, insertable = true, updatable = true, length = 65535)
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "handle_datetime", nullable = true, insertable = true, updatable = true)
    public Timestamp getHandleDatetime() {
        return handleDatetime;
    }

    public void setHandleDatetime(Timestamp handleDatetime) {
        this.handleDatetime = handleDatetime;
    }

    @Basic
    @Column(name = "handle_ip", nullable = true, insertable = true, updatable = true, length = 20)
    public String getHandleIp() {
        return handleIp;
    }

    public void setHandleIp(String handleIp) {
        this.handleIp = handleIp;
    }

    @Basic
    @Column(name = "handle_type", nullable = true, insertable = true, updatable = true)
    public Integer getHandleType() {
        return handleType;
    }

    public void setHandleType(Integer handleType) {
        this.handleType = handleType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SysLogEntity that = (SysLogEntity) o;

        if (id != that.id) return false;
        if (adminId != null ? !adminId.equals(that.adminId) : that.adminId != null) return false;
        if (module != null ? !module.equals(that.module) : that.module != null) return false;
        if (action != null ? !action.equals(that.action) : that.action != null) return false;
        if (handle != null ? !handle.equals(that.handle) : that.handle != null) return false;
        if (handleMan != null ? !handleMan.equals(that.handleMan) : that.handleMan != null) return false;
        if (content != null ? !content.equals(that.content) : that.content != null) return false;
        if (handleDatetime != null ? !handleDatetime.equals(that.handleDatetime) : that.handleDatetime != null)
            return false;
        if (handleIp != null ? !handleIp.equals(that.handleIp) : that.handleIp != null) return false;
        if (handleType != null ? !handleType.equals(that.handleType) : that.handleType != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (adminId != null ? adminId.hashCode() : 0);
        result = 31 * result + (module != null ? module.hashCode() : 0);
        result = 31 * result + (action != null ? action.hashCode() : 0);
        result = 31 * result + (handle != null ? handle.hashCode() : 0);
        result = 31 * result + (handleMan != null ? handleMan.hashCode() : 0);
        result = 31 * result + (content != null ? content.hashCode() : 0);
        result = 31 * result + (handleDatetime != null ? handleDatetime.hashCode() : 0);
        result = 31 * result + (handleIp != null ? handleIp.hashCode() : 0);
        result = 31 * result + (handleType != null ? handleType.hashCode() : 0);
        return result;
    }
}
